package com.example.administrator.myweiyue;

import android.app.Application;

import com.example.administrator.myweiyue.ui.component.AppComponent;
import com.example.administrator.myweiyue.ui.component.DaggerAppComponent;
import com.example.administrator.myweiyue.ui.module.AppModule;
import com.example.administrator.myweiyue.ui.module.HttpModule;

import cn.bingoogolapple.swipebacklayout.BGASwipeBackManager;


/**
 * Created by Administrator on 2018-01-23.
 */

public class MyApplication extends Application {
    private static AppComponent mAppComponent;
    private static MyApplication context;

    @Override
    public void onCreate() {
        super.onCreate();
        context = this;

        mAppComponent = DaggerAppComponent.builder().appModule(new AppModule(this)).httpModule(new HttpModule()).build();
//初始化滑动返回
        BGASwipeBackManager.getInstance().init(this);
    }

    //获取AppComponent
    public static AppComponent getAppComponent() {
        return mAppComponent;
    }

    public static MyApplication getMyApplication() {
        return context;
    }
}
